package com.bbs.web.controller;

import com.bbs.domain.Comment;
import com.bbs.service.ArticleService;
import com.bbs.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName CommentController
 * @Description TODO
 * @Author chen hong wei
 * @Date 2019/9/22 19:30
 */
@RestController
@RequestMapping("/web/comment")
public class CommentController {

    @Autowired
    private CommentService commentService;


    /**
    * @author chen hong wei
    * @Description 根据帖子id查询 评论
    * @Date 19:38 2019/9/22
    * @Param [articleid]
    * @return com.bbs.domain.Comment
    **/
    @GetMapping("/findByArticleId")
    public List<Comment> findByArticleId(int articleId){
       return commentService.findByArticleId(articleId);
    }


}